﻿@model XHouse.Model.Ambiente

@{
    ViewBag.Title = "Nuevo Ambiente";
}

<div class="row">
  <div class="col-xs-12 col-md-10 col-md-offset-1">
    
    <div class="page-header">
      <h3>Nuevo Ambiente</h3>
    </div>

    @using (Html.BeginForm(null, null, FormMethod.Post, new { @class = "form-horizontal", @role = "form", enctype = "multipart/form-data" }))
    {
      if (ViewData.ModelState != null && !ViewData.ModelState.IsValid)
      { 
        <div class="alert alert-danger alert-dismissable">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
            @Html.ValidationSummary(false, "Errores:")
        </div>
      }
      
      <div class="form-group">
        <label class="col-lg-2 control-label" for="Nombre">@Html.DisplayNameFor(model => model.Nombre)</label>
        <div class="col-lg-4">
          @Html.TextBoxFor(model => model.Nombre, new {@class = "form-control"})
        </div>
      </div>
      
      <div class="form-group">
        <label class="col-lg-2 control-label" for="Descripcion">@Html.DisplayNameFor(model => model.Descripcion)</label>
        <div class="col-lg-4">
          @Html.TextAreaFor(model => model.Descripcion, new {@class = "form-control"})
        </div>
      </div>
      
      <div class="form-group">
        <label class="col-lg-2 control-label" for="imagen">Imagen del ambiente</label>
        <div class="col-lg-6">
          <input type="file" name="imagen">
          <p class="help-block">Solo se permiten archivos de imagen. La imagen será redimensionada.</p>
        </div>
      </div>
      
      <div class="form-group">
        <div class="col-lg-offset-2 col-lg-3">
          <button class="btn btn-primary" type="submit">Guardar</button>
          <a class="btn btn-danger" href="@Url.Action("Index")">Cancelar</a>
        </div>
      </div>
    }

  </div>
</div>